package com.company.class10;

/**
 * @Classname Dog
 * @Description 类型说明
 * @Date 2022/5/2 22:39
 * @Created by zbw
 */

public class Dog extends Animal{

    public String ear = "尖耳朵";
    public String voice = "汪汪";
    public String kind = "狗";

    public void watchDoor(){
        System.out.println("狗狗是人类的好朋友，可以守家门");
        System.out.println("狗狗的年龄是"+age);
        //私有变量和方法，不能被子类继承。
//        System.out.println("animal藏了私有对象food"+food);
    }

    public void eat(String food){
        if(food.contains("肉")){
            System.out.println("狗狗很开心，并且围着你转了一圈");
        }else{
            System.out.println("狗子对你翻了个白眼并且打翻了食盆");
        }
    }

    @Override
    public String getKind() {
        return kind;
    }
}
